﻿using OccurrencesCore.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OccurrencesCore.Service
{
    public partial class CompetenceParametersService
    {
        public List<UserProfile> GetRequiredCompetenceApprovals(int occurrenceId)
        {
            OccurrenceService occurrenceService = new OccurrenceService();
            Occurrence occurrence = occurrenceService.FindByKey(occurrenceId);
            double totalInvoiceValue = occurrence.TotalInvoicesValue;
            List<CompetenceParameters> parameters = this._Repository.FindBasedOnInitialValue(totalInvoiceValue);
            return parameters.Select(p => p.UserProfile).ToList();
        }
    }
}
